<?php
	$bgcolor = "red";
?>
<table>
<tbody>
<tr>
	<td>valor1</td>
	<td>valor2</td>
	<td>valor3</td>
</tr>
<tr>
	<td>valor4</td>
	<?php $i=1; $j=3; if($i % 2 == 1) $bgcolor = "green"; else $bgcolor = "red";?>
	<?php echo " <td bgcolor=\"$bgcolor\">linha $i coluna $j</td>"; ?>
	<td>valor6</td>
</tr>
</tbody>
</table>